import 'package:thinking/config/_.dart';
import 'CountryEntity.dart';

class HomeEntity {

  int? _code;
  HomeResult? _data;
  String? _message;

  HomeEntity({int? code,HomeResult? data,String? message}){
    this._code = code;
    this._data = data;
    this._message = message;
  }

  int? get code => _code;
  set setCode(int code)=>_code = code;
  String? get message => _message;
  set setMessage(String message) => _message = message;
  HomeResult? get data =>_data;
  set getData(HomeResult data) => _data = data;
  HomeEntity.fromJson(Map<String,dynamic> json){

    _code = json['code'];
    _data = json['data'] != null ?  HomeResult.fromJson(json['data']):null;
    _message = json['message'];

  }

  Map<String,dynamic> toJson(){
    final Map<String,dynamic> data = new Map<String,dynamic>();
    data['code'] = this._code;
    data['message'] = this._message;
    data['data'] = this._data!.toJson();

    return data;
  }

}

class HomeResult{
  List<Think>? _thinkData;
  List<BannerItem>? _bannerData;
  HomeResult( List<Think>? thinkData,List<BannerItem>? bannerData){this._thinkData = thinkData;this._bannerData = bannerData;}

  List<Think>? get thinkData => _thinkData;
  set setThinkData(List<Think> thinkData) => _thinkData = thinkData;
  List<BannerItem>? get bannerData => _bannerData;
  set setBannerData(List<BannerItem> bannerData) => _bannerData = bannerData;

  HomeResult.fromJson(Map<String, dynamic> json) {
    if(json['thinkData'] != null){
      _thinkData = [];
      json['thinkData'].forEach((v) {
        _thinkData!.add( Think.fromJson(v));
      });
    }

    if(json['bannerData'] != null){
      _bannerData = [];
      json['bannerData'].forEach((v) {
        _bannerData!.add( BannerItem.fromJson(v));
      });
    }

  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this._thinkData != null) {
      data['thinkData'] = this._thinkData!.map((v) => v.toJson()).toList();
    }
    if (this._bannerData != null) {
      data['bannerData'] = this._bannerData!.map((v) => v.toJson()).toList();
    }

    return data;
  }
}

class Think{

  int? _id;
  int? _thinkStatus;
  String? _thinkTitle;
  String? _thinkIndexImageUrl;
  int? _thinkCategory;
  String? _thinkCreateTime;
  int? _thinkCollectionType;
  int? _thinkWatchType;
  int? _thinkBlockType;
  int? _thinkLikeType;
  int? _thinkIndexImageWidth;
  int? _thinkIndexImageHeight;
  String? _thinkUserImage;
  Time? _thinkTime;
  CountryData? _thinkCountry;
  ThinkInfo? _thinkInfo;
  ThinkPaint? _thinkPaint;
  ThinkAncient? _thinkAncient;
  String? _thinkTimes;
  bool? _isLike;
  bool? _isCollection;


  Think({
    int? id,
    int? thinkStatus,
    String? thinkTitle,
    String? thinkIndexImageUrl,
    int? thinkCategory,
    int? thinkIndexImageStatus,
    String? thinkCreateTime,
    int? thinkCollectionType,
    String? thinkImageList,
    String? thinkContent,
    String? tagIdList,
    int? thinkWatchType,
    int? thinkBlockType,
    int? thinkLikeType,
    int? thinkIndexImageWidth,
    int? thinkIndexImageHeight,
    String? thinkUserImage,
    Time? thinkTime,
    CountryData? thinkCountry,
    ThinkInfo? thinkInfo,
    ThinkPaint? thinkPaint,
    ThinkAncient? thinkAncient,
    String? thinkTimes,
    bool? isLike,
    bool? isCollection
  }){
    this._id = id;
    this._thinkStatus = thinkStatus;
    this._thinkTitle = thinkTitle;
    this._thinkIndexImageUrl = thinkIndexImageUrl;
    this._thinkCategory = thinkCategory;
    this._thinkCreateTime = thinkCreateTime;
    this._thinkCollectionType = thinkCollectionType;
    this._thinkWatchType = thinkWatchType;
    this._thinkBlockType = thinkBlockType;
    this._thinkLikeType = thinkLikeType;
    this._thinkIndexImageWidth = thinkIndexImageWidth;
    this._thinkIndexImageHeight = thinkIndexImageHeight;
    this._thinkUserImage = thinkUserImage;
    this._thinkTime = thinkTime;
    this._thinkCountry = thinkCountry;
    this._thinkInfo = thinkInfo;
    this._thinkPaint = thinkPaint;
    this._thinkAncient = thinkAncient;
    this._thinkTimes = thinkTimes;
    this._isLike = isLike;
    this._isCollection = isCollection;
  }


  int? get id => _id;
  set setId(int id) => _id = id;
  int? get thinkStatus => _thinkStatus;
  set setThinkStatus(int thinkStatus) => _thinkStatus = thinkStatus;
  String? get thinkTitle => _thinkTitle;
  set setThinkTitle(String thinkTitle) => _thinkTitle = thinkTitle;
  String? get thinkIndexImageUrl => _thinkIndexImageUrl;
  set setThinkIndexImageUrl(String thinkIndexImageUrl) => _thinkIndexImageUrl = thinkIndexImageUrl;
  int? get thinkCategory => _thinkCategory;
  set setThinkCategory(int thinkCategory) => _thinkCategory = thinkCategory;
  String? get thinkCreateTime => _thinkCreateTime;
  set setThinkCreateTime(String thinkCreateTime) => _thinkCreateTime = thinkCreateTime;
  int? get thinkCollectionType => _thinkCollectionType;
  set setThinkCollectionType(int thinkCollectionType) => _thinkCollectionType = thinkCollectionType;
  int? get thinkWatchType => _thinkWatchType;
  set setThinkWatchType(int thinkWatchType) => _thinkWatchType = thinkWatchType;
  int? get thinkBlockType => _thinkBlockType;
  set setThinkBlockType(int thinkBlockType) => _thinkBlockType = thinkBlockType;
  int? get thinkLikeType => _thinkLikeType;
  set setThinkLikeType(int thinkLikeType) => _thinkLikeType = thinkLikeType;
  int? get thinkIndexImageWidth => _thinkIndexImageWidth;
  set setThinkIndexImageWidth(int thinkIndexImageWidth) => _thinkIndexImageWidth = thinkIndexImageWidth;
  int? get thinkIndexImageHeight => _thinkIndexImageHeight;
  set setThinkIndexImageHeight(int thinkIndexImageHeight) => _thinkIndexImageHeight = thinkIndexImageHeight;
  String? get thinkUserImage => _thinkUserImage;
  set setThinkUserImage(String thinkUserImage) => _thinkUserImage = thinkUserImage;
  Time? get thinkTime => _thinkTime;
  set setThinkTime(Time thinkTime) => _thinkTime = thinkTime;
  CountryData? get thinkCountry => _thinkCountry;
  set setThinkCountry(CountryData thinkCountry) => _thinkCountry = thinkCountry;
  ThinkInfo? get thinkInfo => _thinkInfo;
  set setThinkInfo(ThinkInfo thinkInfo) => _thinkInfo = thinkInfo;
  ThinkPaint? get thinkPaint => _thinkPaint;
  set setThinkPaint(ThinkPaint thinkPaint) => _thinkPaint = thinkPaint;
  ThinkAncient? get thinkAncient => _thinkAncient;
  set setThinkAncient(ThinkAncient thinkAncient) => _thinkAncient = thinkAncient;
  String? get thinkTimes => _thinkTimes;
  set setThinkTimes(String thinkTimes) => _thinkTimes = thinkTimes;
  bool? get isLike => _isLike;
  set setIsLike(bool? isLike) => _isLike = isLike;
  bool? get isCollection => _isCollection;
  set setIsCollection(bool? isCollection) => _isCollection = isCollection;

  Think.fromJson(Map<String, dynamic> json) {
    _id = json['id'];
    _thinkStatus = json['think_Status'] != null?json['think_Status']:0;
    _thinkTitle = json['think_Title'];
    _thinkIndexImageUrl = Config.apiUrl['BasePhotoUrl'] + json['think_IndexImageUrl'];
    _thinkCategory = json['think_Category'];
    _thinkCreateTime = json['think_CreateTime'];
    _thinkCollectionType = json['think_CollectionType'];
    _thinkWatchType = json['think_WatchType'];
    _thinkBlockType = json['think_BlockType'];
    _thinkLikeType = json['think_LikeType'];
    _thinkIndexImageWidth = json['think_IndexImageWidth'];
    _thinkIndexImageHeight = json['think_IndexImageHeight'];
    _thinkUserImage = json['think_UserImage'];
    _thinkTime = json['think_Time'] != null ?  Time.fromJson(json['think_Time']) : null;
    _thinkCountry = json['think_Country'] != null ?  CountryData.fromJson(json['think_Country']) : null;
    _thinkInfo = json['think_Info'] != null ?  ThinkInfo.fromJson(json['think_Info']) : null;
    _thinkPaint = json['think_Paint'] != null ?  ThinkPaint.fromJson(json['think_Paint']) : null;
    _thinkAncient = json['think_Ancient'] != null ?  ThinkAncient.fromJson(json['think_Ancient']) : null;
    _thinkTimes = json['think_Times'];
    _isLike = json['isLike']!=null?json['isLike']:false;
    _isCollection = json['isCollection']!=null?json['isCollection']:false;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this._id;
    data['think_Title'] = this._thinkStatus;
    data['think_Title'] = this._thinkTitle;
    data['think_IndexImageUrl'] = this._thinkIndexImageUrl;
    data['think_Category'] = this._thinkCategory;
    data['think_CreateTime'] = this._thinkCreateTime;
    data['think_CollectionType'] = this._thinkCollectionType;
    data['think_WatchType'] = this._thinkWatchType;
    data['think_BlockType'] = this._thinkBlockType;
    data['think_LikeType'] = this._thinkLikeType;
    data['think_IndexImageWidth'] = this._thinkIndexImageWidth;
    data['think_IndexImageHeight'] = this._thinkIndexImageHeight;
    data['think_UserImage'] = this._thinkUserImage;
    data["isLike"] = this.isLike;
    data["isCollection"] = this.isCollection;
    if (this._thinkTime != null) {
      data['think_Time'] = this._thinkTime!.toJson();
    }
    if (this._thinkCountry != null) {
      data['think_Country'] = this._thinkCountry!.toJson();
    }
    if (this._thinkInfo != null) {
      data['think_Info'] = this._thinkInfo!.toJson();
    }
    if (this._thinkPaint != null) {
      data['think_Paint'] = this._thinkPaint!.toJson();
    }
    if (this._thinkAncient != null) {
      data['think_Ancient'] = this._thinkAncient!.toJson();
    }

    data['think_Times'] = this._thinkTimes;
    return data;
  }
}

class BannerItem{

  int? _bannerId;
  String? _bannerUrl;
  int? _bannerType;
  int? _bannerContentId;
  String? _bannerValue;

  BannerItem({
    int? bannerId,
    String? bannerUrl,
    int? bannerType,
    int? bannerContentId,
    String? bannerValue,


  }){
    this._bannerId = bannerId;
    this._bannerUrl = bannerUrl;
    this._bannerType = bannerType;
    this._bannerContentId = bannerContentId;
    this._bannerValue = bannerValue;



  }

  int? get bannerId => _bannerId;
  set setBannerId(int bannerId) => _bannerId = bannerId;
  String? get bannerUrl => _bannerUrl;
  set setBannerUrl(String bannerUrl) => _bannerUrl = bannerUrl;
  int? get bannerType => _bannerType;
  set setBannerType(int bannerType) => _bannerType = bannerType;
  int? get bannerContentId => _bannerContentId;
  set setBannerContentId(int bannerContentId) => _bannerContentId = bannerContentId;
  String? get bannerValue => _bannerValue;
  set setId(String bannerValue) => _bannerValue = bannerValue;


  BannerItem.fromJson(Map<String, dynamic> json) {
    _bannerId = json['banner_Id'];
    _bannerUrl = Config.apiUrl['BasePhotoUrl'] + json['banner_Url'] ;
    _bannerType = json['banner_Type'];
    _bannerContentId =  json['banner_ContentId'];
    _bannerValue = json['banner_Value'];
  }

  Map<String,dynamic> toJson(){
    final Map<String,dynamic> data = new Map<String,dynamic>();
    data['banner_Id'] = this._bannerId;
    data['banner_Url'] = this._bannerUrl;
    data['banner_Type'] = this._bannerType;
    data['banner_ContentId'] = this._bannerContentId;
    data['banner_Value'] = this._bannerValue;

    return data;
  }

}
class HomePage{



  int _thinkPage = 0;
  int _thinkCount = 6;
  bool _canThink = true;

  int get thinkPage => _thinkPage;
  set setThinkPage(int thinkPage) => _thinkPage = thinkPage;
  int get thinkCount => _thinkCount;
  set setThinkCount(int thinkCount) => _thinkCount = thinkCount;
  bool get canThink => _canThink;
  set setCanThink(bool canThink) => _canThink = canThink;

}

class ThinkInfo{


  int? _thinkId;
  List<dynamic>? _thinkInfo;
  List<dynamic>? _thinkTagList;
  String? _thinkUserName;

  ThinkInfo({
    int? thinkId,
    List<dynamic>? thinkInfo,
    List<dynamic>? thinkTagList,
    String? thinkUserName


  }){
    this._thinkId = thinkId;
    this._thinkInfo = thinkInfo;
    this._thinkTagList = thinkTagList;
    this._thinkUserName = thinkUserName;


  }

  int? get thinkId => _thinkId;
  set setThinkId(int thinkId) => _thinkId = thinkId;
  List<dynamic>? get thinkInfo => _thinkInfo;
  set setThinkInfo(List<dynamic> thinkInfo) => _thinkInfo = thinkInfo;
  List<dynamic>? get thinkTagList => _thinkTagList;
  set setThinkTagList(List<dynamic> thinkTagList) => _thinkTagList = thinkTagList;
  String? get thinkUserName => _thinkUserName;
  set setThinkUserName(String thinkUserName) => _thinkUserName = thinkUserName;



  ThinkInfo.fromJson(Map<String, dynamic> json) {
    _thinkId = json['think_Id'];
    _thinkInfo = json['think_Info'];
    _thinkTagList = json['think_TagList'];
    _thinkUserName = json['think_UserName'];
  }

  Map<String,dynamic> toJson(){
    final Map<String,dynamic> data = new Map<String,dynamic>();
    data['think_Id'] = this._thinkId;
    data['think_Info'] = this._thinkInfo;
    data['think_TagList'] = this._thinkTagList;
    data['think_UserName'] = this._thinkUserName;

    return data;
  }

}

class ThinkPaint{


  int? _paintId;
  List<dynamic>? _paintInfo;
  List<dynamic>? _paintTagList;
  String? _paintUserName;
  String? _paintRow;
  String? _paintStyle;
  String? _paintTheme;
  String? _paintCollection;

  ThinkPaint({
    int? paintId,
    List<dynamic>? paintInfo,
    List<dynamic>? paintTagList,
    String? paintUserName,
    String? paintRow,
    String? paintStyle,
    String? paintTheme,
    String? paintCollection


  }){
    this._paintId = paintId;
    this._paintInfo = paintInfo;
    this._paintTagList = paintTagList;
    this._paintUserName = paintUserName;
    this._paintRow = paintRow;
    this._paintStyle = paintStyle;
    this._paintTheme = paintTheme;
    this._paintCollection = paintCollection;
  }

  int? get paintId => _paintId;
  set setPaintId(int paintId) => _paintId = paintId;
  List<dynamic>? get paintInfo => _paintInfo;
  set setPaintInfo(List<dynamic> paintInfo) => _paintInfo = paintInfo;
  List<dynamic>? get paintTagList => _paintTagList;
  set setPaintTagList(List<dynamic> paintTagList) => _paintTagList = paintTagList;
  String? get paintUserName => _paintUserName;
  set setPaintUserName(String paintUserName) => _paintUserName = paintUserName;
  String? get paintRow => _paintRow;
  set setPaintRow(String paintRow) => _paintRow = paintRow;
  String? get paintStyle => _paintStyle;
  set setPaintStyle(String paintStyle) => _paintStyle = paintStyle;
  String? get paintTheme => _paintTheme;
  set setPaintTheme(String paintTheme) => _paintTheme = paintTheme;
  String? get paintCollection => _paintCollection;
  set setPaintCollection(String paintCollection) => _paintCollection = paintCollection;


  ThinkPaint.fromJson(Map<String, dynamic> json) {
    _paintId = json['paint_Id'];
    _paintInfo = json['paint_Info'];
    _paintTagList = json['paint_TagList'];
    _paintUserName = json['paint_UserName'];
    _paintRow = json['paint_Row'];
    _paintStyle = json['paint_Style'];
    _paintTheme = json['paint_Theme'];
    _paintCollection = json['paint_Collection'];
  }

  Map<String,dynamic> toJson(){
    final Map<String,dynamic> data = new Map<String,dynamic>();
    data['paint_Id'] = this._paintId;
    data['paint_Info'] = this._paintInfo;
    data['paint_TagList'] = this._paintTagList;
    data['paint_UserName'] = this._paintUserName;
    data['paint_Row'] = this._paintRow;
    data['paint_Style'] = this._paintStyle;
    data['paint_Theme'] = this._paintTheme;
    data['paint_Collection'] = this._paintCollection;
    return data;
  }

}

class ThinkAncient{


  int? _ancientId;
  List<dynamic>? _ancientInfo;
  List<dynamic>? _ancientTagList;
  String? _ancientUserName;
  String? _ancientPosition;
  String? _ancientType;

  ThinkAncient({
    int? ancientId,
    List<dynamic>? ancientInfo,
    List<dynamic>? ancientTagList,
    String? ancientUserName,
    String? ancientPosition,
    String? ancientType,


  }){
    this._ancientId = ancientId;
    this._ancientInfo = ancientInfo;
    this._ancientTagList = ancientTagList;
    this._ancientUserName = ancientUserName;
    this._ancientPosition = ancientPosition;
    this._ancientType = ancientType;
  }

  int? get ancientId => _ancientId;
  set setAncientId(int ancientId) => _ancientId = ancientId;
  List<dynamic>? get ancientInfo => _ancientInfo;
  set setAncientInfo(List<dynamic> ancientInfo) => _ancientInfo = ancientInfo;
  List<dynamic>? get ancientTagList => _ancientTagList;
  set setAncientTagList(List<dynamic> ancientTagList) => _ancientTagList = ancientTagList;
  String? get ancientUserName => _ancientUserName;
  set setAncientUserName(String ancientUserName) => _ancientUserName = ancientUserName;
  String? get ancientPosition => _ancientPosition;
  set setPaintRow(String ancientPosition) => _ancientPosition = ancientPosition;
  String? get ancientType => _ancientType;
  set setAncientType(String ancientType) => _ancientType = ancientType;


  ThinkAncient.fromJson(Map<String, dynamic> json) {
    _ancientId = json['ancient_Id'];
    _ancientInfo = json['ancient_Info'];
    _ancientTagList = json['ancient_TagList'];
    _ancientUserName = json['ancient_UserName'];
    _ancientPosition = json['ancient_Position'];
    _ancientType = json['ancient_Type'];
  }

  Map<String,dynamic> toJson(){
    final Map<String,dynamic> data = new Map<String,dynamic>();
    data['ancient_Id'] = this._ancientId;
    data['ancient_Info'] = this._ancientInfo;
    data['ancient_TagList'] = this._ancientTagList;
    data['ancient_UserName'] = this._ancientUserName;
    data['ancient_Position'] = this._ancientPosition;
    data['ancient_Type'] = this._ancientType;
    return data;
  }

}


